﻿//
// <author>David Nohejl</author>
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WPFTrees.DataStructures;
using WPFTrees.Parser;

namespace WPFTrees.Layouts
{
    /// <summary>
    /// Zakladni trida vsech layoutu. Poskytuje zakladni implementaci nekterych
    /// metod ILayout.
    /// </summary>
    public abstract class LayoutBase:ILayout
    {
        /// <inheritdoc />        
        public abstract void ExecuteLayout(System.Windows.Controls.Canvas canvas,
            NTree<NewickNode> tree);
        
        /// <inheritdoc />        
        public NTree<NewickNode> Tree
        {
            get
            {
                return _tree;
            }
            set
            {
                _tree = value;
            }
        }
        
        /// <inheritdoc />        
        public bool IsRooted
        {
            get
            {
                return _isRooted;
            }
        }

        /// <inheritdoc />
        public IBranchDrawer BranchDrawer
        {
            get
            {
                return _branchDrawer;
            }
            set
            {
                _branchDrawer = value;
            }
        }
        
        //TODO: protected nebo private?
        protected bool _isRooted;

        protected NTree<NewickNode> _tree;

        protected IBranchDrawer _branchDrawer;
    }
}
